object dmDic: TdmDic
  OldCreateOrder = False
  OnCreate = DataModuleCreate
  OnDestroy = DataModuleDestroy
  Left = 216
  Top = 107
  Height = 627
  Width = 762
  object trMainTransaction: TIBTransaction
    Active = False
    DefaultDatabase = dbArm2
    Params.Strings = (
      'read_committed'
      'rec_version'
      'nowait')
    AutoStopAction = saNone
    Left = 104
    Top = 8
  end
  object qryEK: TIBQuery
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = False
    SQL.Strings = (
      'SELECT * FROM EK'
      'ORDER BY AWTOR')
    Left = 32
    Top = 56
  end
  object qryBooks: TIBQuery
    Tag = 3006
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = True
    SQL.Strings = (
      'SELECT * FROM EK'
      '/* FILTER PLACE */'
      '/* FILTER PLACE */')
    Left = 32
    Top = 104
  end
  object tblBooks: TIBTable
    Database = dbArm2
    Transaction = trMainTransaction
    AutoCalcFields = False
    OnUpdateError = tblBooksUpdateError
    BufferChunks = 1000
    CachedUpdates = False
    StoreDefs = True
    TableName = 'EK'
    Left = 32
    Top = 160
  end
  object qryEkLoad: TIBQuery
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = False
    SQL.Strings = (
      'INSERT INTO EK VALUES('
      '      :ID, :AWTOR, :IMYAAWTOR, :ZAGLAWIE, :DOPZAGLAWIE,'
      '      :DOPAWTOR, :TOM, :ZAGLAWIET, :AWTORT, :IMYAAWTORT,'
      '      :DOPAWTORT, :POWTORN, :MESTOIZD, :IZDAT, :GOD,'
      '      :GODN, :GODK, :STR, :SERIYA, :PODSERIYA, :PRIMECHAN,'
      '      :CENA, :OTDEL, :POLINDEXU, :POLINDEXB, :KATINDEXU,'
      '      :KATINDEXB, :AWTZNAK, :PREDMET, :FORMAT, :INW_N,'
      '      :HRANENIE, :ANNOTACIYA, :DATE_ZAP, :KSU, :ISBNM,'
      '      :DOPZAGLAWIET, :SPISK, :PRIMECHANT, :ALLISA_N,'
      '      :EKZ, :N_KSU, :EKZ_KSU, :SODERGANYE)')
    Left = 32
    Top = 216
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'ID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'AWTOR'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'IMYAAWTOR'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ZAGLAWIE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'DOPZAGLAWIE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'DOPAWTOR'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'TOM'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ZAGLAWIET'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'AWTORT'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'IMYAAWTORT'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'DOPAWTORT'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'POWTORN'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'MESTOIZD'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'IZDAT'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'GOD'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'GODN'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'GODK'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'STR'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SERIYA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PODSERIYA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PRIMECHAN'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'CENA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'OTDEL'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'POLINDEXU'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'POLINDEXB'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'KATINDEXU'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'KATINDEXB'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'AWTZNAK'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PREDMET'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'FORMAT'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'INW_N'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'HRANENIE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ANNOTACIYA'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'DATE_ZAP'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'KSU'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ISBNM'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'DOPZAGLAWIET'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SPISK'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PRIMECHANT'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'ALLISA_N'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'EKZ'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'N_KSU'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'EKZ_KSU'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SODERGANYE'
        ParamType = ptUnknown
      end>
  end
  object sqlEkLoad: TIBSQL
    Database = dbArm2
    ParamCheck = True
    Transaction = trMainTransaction
    Left = 32
    Top = 272
  end
  object dbArm2: TIBDatabase
    DatabaseName = 'C:\Biblio\Data\Arm3.fdb'
    Params.Strings = (
      'user_name=LIB2'
      'password=1024'
      'sql_role_name=LIBRARIAN')
    LoginPrompt = False
    IdleTimer = 0
    SQLDialect = 3
    TraceFlags = [tfQExecute, tfTransact]
    AllowStreamedConnected = False
    Left = 32
    Top = 8
  end
  object qryBookEntry: TIBQuery
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = True
    SQL.Strings = (
      'SELECT * FROM EK'
      'WHERE ID_STR = :ID_STR')
    UpdateObject = UpdateBookEntry
    Left = 104
    Top = 160
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'ID_STR'
        ParamType = ptUnknown
      end>
  end
  object UpdateBookEntry: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  ID,'
      '  AWTOR,'
      '  IMYAAWTOR,'
      '  ZAGLAWIE,'
      '  DOPZAGLAWIE,'
      '  DOPAWTOR,'
      '  TOM,'
      '  ZAGLAWIET,'
      '  AWTORT,'
      '  IMYAAWTORT,'
      '  DOPAWTORT,'
      '  POWTORN,'
      '  MESTOIZD,'
      '  IZDAT,'
      '  GOD,'
      '  GODN,'
      '  GODK,'
      '  STR,'
      '  SERIYA,'
      '  PODSERIYA,'
      '  PRIMECHAN,'
      '  CENA,'
      '  OTDEL,'
      '  POLINDEXU,'
      '  POLINDEXB,'
      '  KATINDEXU,'
      '  KATINDEXB,'
      '  AWTZNAK,'
      '  PREDMET,'
      '  FORMAT,'
      '  INW_N,'
      '  HRANENIE,'
      '  ANNOTACIYA,'
      '  DATE_ZAP,'
      '  KSU,'
      '  ISBNM,'
      '  DOPZAGLAWIET,'
      '  SPISK,'
      '  PRIMECHANT,'
      '  ALLISA_N,'
      '  EKZ,'
      '  GOD_KSU,'
      '  N_KSU,'
      '  EKZ_KSU,'
      '  SODERGANYE,'
      '  PRIM,'
      '  PRILOJ'
      'from EK '
      'where'
      '  ID = :ID')
    ModifySQL.Strings = (
      'update EK'
      'set'
      '  ID = :ID,'
      '  ID_STR = :ID_STR,'
      '  AWTOR = :AWTOR,'
      '  IMYAAWTOR = :IMYAAWTOR,'
      '  ZAGLAWIE = :ZAGLAWIE,'
      '  DOPZAGLAWIE = :DOPZAGLAWIE,'
      '  DOPAWTOR = :DOPAWTOR,'
      '  TOM = :TOM,'
      '  ZAGLAWIET = :ZAGLAWIET,'
      '  AWTORT = :AWTORT,'
      '  IMYAAWTORT = :IMYAAWTORT,'
      '  DOPAWTORT = :DOPAWTORT,'
      '  POWTORN = :POWTORN,'
      '  MESTOIZD = :MESTOIZD,'
      '  IZDAT = :IZDAT,'
      '  GOD = :GOD,'
      '  GODN = :GODN,'
      '  GODK = :GODK,'
      '  STR = :STR,'
      '  SERIYA = :SERIYA,'
      '  PODSERIYA = :PODSERIYA,'
      '  PRIMECHAN = :PRIMECHAN,'
      '  CENA = :CENA,'
      '  OTDEL = :OTDEL,'
      '  POLINDEXU = :POLINDEXU,'
      '  POLINDEXB = :POLINDEXB,'
      '  KATINDEXU = :KATINDEXU,'
      '  KATINDEXB = :KATINDEXB,'
      '  AWTZNAK = :AWTZNAK,'
      '  PREDMET = :PREDMET,'
      '  FORMAT = :FORMAT,'
      '  INW_N = :INW_N,'
      '  HRANENIE = :HRANENIE,'
      '  ANNOTACIYA = :ANNOTACIYA,'
      '  DATE_ZAP = :DATE_ZAP,'
      '  KSU = :KSU,'
      '  ISBNM = :ISBNM,'
      '  DOPZAGLAWIET = :DOPZAGLAWIET,'
      '  SPISK = :SPISK,'
      '  PRIMECHANT = :PRIMECHANT,'
      '  ALLISA_N = :ALLISA_N,'
      '  EKZ = :EKZ,'
      '  GOD_KSU = :GOD_KSU,'
      '  N_KSU = :N_KSU,'
      '  EKZ_KSU = :EKZ_KSU,'
      '  SODERGANYE = :SODERGANYE,'
      '  PRIM = :PRIM,'
      '  PRILOJ = :PRILOJ'
      'where'
      '  ID = :OLD_ID')
    InsertSQL.Strings = (
      'insert into EK'
      
        '  (ID, ID_STR, AWTOR, IMYAAWTOR, ZAGLAWIE, DOPZAGLAWIE, DOPAWTOR' +
        ', '
      'TOM, '
      'ZAGLAWIET, '
      
        '   AWTORT, IMYAAWTORT, DOPAWTORT, POWTORN, MESTOIZD, IZDAT, GOD,' +
        ' '
      'GODN, '
      
        '   GODK, STR, SERIYA, PODSERIYA, PRIMECHAN, CENA, OTDEL, POLINDE' +
        'XU, '
      'POLINDEXB, '
      '   KATINDEXU, KATINDEXB, AWTZNAK, PREDMET, FORMAT, INW_N, '
      'HRANENIE, ANNOTACIYA, '
      
        '   DATE_ZAP, KSU, ISBNM, DOPZAGLAWIET, SPISK, PRIMECHANT, ALLISA' +
        '_N, '
      'EKZ, GOD_KSU,'
      '   N_KSU, EKZ_KSU, SODERGANYE, PRIM, PRILOJ)'
      'values'
      '  (:ID, :ID_STR, :AWTOR, :IMYAAWTOR, :ZAGLAWIE, :DOPZAGLAWIE, '
      ':DOPAWTOR, :TOM, '
      ':ZAGLAWIET, '
      
        '   :AWTORT, :IMYAAWTORT, :DOPAWTORT, :POWTORN, :MESTOIZD, :IZDAT' +
        ', '
      ':GOD, '
      
        '   :GODN, :GODK, :STR, :SERIYA, :PODSERIYA, :PRIMECHAN, :CENA, :' +
        'OTDEL, '
      '   :POLINDEXU, :POLINDEXB, :KATINDEXU, :KATINDEXB, :AWTZNAK, '
      ':PREDMET, '
      
        '   :FORMAT, :INW_N, :HRANENIE, :ANNOTACIYA, :DATE_ZAP, :KSU, :IS' +
        'BNM, '
      ':DOPZAGLAWIET, '
      
        '   :SPISK, :PRIMECHANT, :ALLISA_N, :EKZ, :GOD_KSU, :N_KSU, :EKZ_' +
        'KSU, '
      ':SODERGANYE, :PRIM, :PRILOJ)')
    DeleteSQL.Strings = (
      'delete from EK'
      'where'
      '  ID = :OLD_ID')
    Left = 192
    Top = 160
  end
  object sprGetBookId: TIBStoredProc
    Database = dbArm2
    Transaction = trMainTransaction
    StoredProcName = 'GET_BOOK_ID'
    Left = 192
    Top = 104
  end
  object qryTmp: TIBQuery
    Database = dbArm2
    Transaction = trTmp
    BufferChunks = 1000
    CachedUpdates = False
    Left = 32
    Top = 384
  end
  object qInvBookFil: TIBQuery
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = False
    SQL.Strings = (
      'SELECT * FROM INV_BOOK_FIL(:FIL_NO, :KSU_NO)')
    Left = 192
    Top = 8
    ParamData = <
      item
        DataType = ftInteger
        Name = 'FIL_NO'
        ParamType = ptUnknown
      end
      item
        DataType = ftString
        Name = 'KSU_NO'
        ParamType = ptUnknown
      end>
  end
  object qParties: TIBQuery
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = False
    SQL.Strings = (
      'SELECT n_ksu, sum(ekz)'
      'from HRAN'
      'where GOD_KSU = :GOD_KSU'
      'group by n_ksu')
    Left = 104
    Top = 56
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'GOD_KSU'
        ParamType = ptUnknown
      end>
  end
  object qParty: TIBQuery
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = False
    SQL.Strings = (
      
        'SELECT ID, EKZ, FIL, DATE_ZAP, ID_STR, ZAGL, GOD, GODN, CENA, OT' +
        'DEL, FORMAT, RAZDEL'
      'FROM INV_BOOK1 WHERE N_KSU = :N_KSU'
      'AND GOD_KSU = :GOD_KSU'
      '/* RAZDEL */'
      '/* FILIAL */'
      '/* HRANENIE */'
      'ORDER BY ID_STR'
      '')
    Left = 192
    Top = 56
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'N_KSU'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'GOD_KSU'
        ParamType = ptUnknown
      end>
  end
  object dsInvBookFil: TDataSource
    AutoEdit = False
    DataSet = qInvBookFil
    Left = 264
    Top = 8
  end
  object qryFormats: TIBQuery
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = False
    SQL.Strings = (
      'SELECT * FROM FORMATS'
      'ORDER BY ID')
    Left = 104
    Top = 272
  end
  object IBEvents: TIBEvents
    AutoRegister = False
    Database = dbArm2
    Events.Strings = (
      'NEW_BOOK')
    Registered = False
    OnEventAlert = IBEventsEventAlert
    Left = 184
    Top = 216
  end
  object DBInfo: TIBDatabaseInfo
    Database = dbArm2
    Left = 184
    Top = 272
  end
  object dsHran: TIBDataSet
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = False
    DeleteSQL.Strings = (
      'delete from HRAN'
      'where'
      '  ID = :OLD_ID')
    InsertSQL.Strings = (
      'insert into HRAN'
      '  (ID, BOOK_ID, N_KSU, GOD_KSU, EKZ, FIL, EKZ_OST)'
      'values'
      '  (:ID, :BOOK_ID, :N_KSU, :GOD_KSU, :EKZ, :FIL, :EKZ_OST)')
    RefreshSQL.Strings = (
      'Select '
      '  ID,'
      '  BOOK_ID,'
      '  N_KSU,'
      '  GOD_KSU,'
      '  EKZ,'
      '  FIL,'
      '  EKZ_OST'
      'from HRAN '
      'where'
      '  ID = :ID')
    SelectSQL.Strings = (
      'SELECT * FROM HRAN'
      'WHERE BOOK_ID = :BOOK_ID')
    ModifySQL.Strings = (
      'update HRAN'
      'set'
      '  ID = :ID,'
      '  BOOK_ID = :BOOK_ID,'
      '  N_KSU = :N_KSU,'
      '  GOD_KSU = :GOD_KSU,'
      '  EKZ = :EKZ,'
      '  FIL = :FIL,'
      '  EKZ_OST = :EKZ_OST'
      'where'
      '  ID = :OLD_ID')
    GeneratorField.Field = 'ID'
    GeneratorField.Generator = 'GEN_HRAN_ID'
    Left = 264
    Top = 64
  end
  object sprGetBookIdStr: TIBStoredProc
    Database = dbArm2
    Transaction = trMainTransaction
    StoredProcName = 'GET_BOOK_ID_STR'
    Left = 264
    Top = 120
  end
  object dsHranOst: TIBDataSet
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = False
    DeleteSQL.Strings = (
      'delete from HRAN_OST'
      'where'
      '  ID = :OLD_ID')
    InsertSQL.Strings = (
      'insert into HRAN_OST'
      '  (ID, BOOK_ID, FIL, EKZ)'
      'values'
      '  (:ID, :BOOK_ID, :FIL, :EKZ)')
    RefreshSQL.Strings = (
      'Select '
      '  ID,'
      '  BOOK_ID,'
      '  FIL,'
      '  EKZ'
      'from HRAN_OST '
      'where'
      '  ID = :ID')
    SelectSQL.Strings = (
      'SELECT * FROM HRAN_OST'
      'WHERE BOOK_ID = :BOOK_ID')
    ModifySQL.Strings = (
      'update HRAN_OST'
      'set'
      '  ID = :ID,'
      '  BOOK_ID = :BOOK_ID,'
      '  FIL = :FIL,'
      '  EKZ = :EKZ'
      'where'
      '  ID = :OLD_ID')
    GeneratorField.Field = 'ID'
    GeneratorField.Generator = 'GEN_HRAN_OST_ID'
    Left = 320
    Top = 64
  end
  object dsCurrentHran: TIBDataSet
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = False
    SelectSQL.Strings = (
      'SELECT * FROM HRAN'
      'WHERE BOOK_ID = :BOOK_ID'
      'AND GOD_KSU = :GOD_KSU'
      'AND N_KSU = :N_KSU')
    Left = 320
    Top = 112
  end
  object qryBookList: TIBQuery
    Database = dbArm2
    Transaction = trMainTransaction
    BufferChunks = 1000
    CachedUpdates = False
    SQL.Strings = (
      'SELECT * FROM BOOK_LIST')
    Left = 32
    Top = 328
    object qryBookListID: TIntegerField
      FieldName = 'ID'
      Origin = 'BOOK_LIST.ID'
    end
    object qryBookListID_STR: TIBStringField
      FieldName = 'ID_STR'
      Origin = 'BOOK_LIST.ID_STR'
      Size = 12
    end
    object qryBookListZAGL: TIBStringField
      FieldKind = fkInternalCalc
      FieldName = 'ZAGL'
      Origin = 'BOOK_LIST.ZAGL'
      ReadOnly = True
      Size = 350
    end
    object qryBookListAZ: TIBStringField
      FieldName = 'AZ'
      Origin = 'BOOK_LIST.AZ'
      Size = 150
    end
    object qryBookListBBK: TIBStringField
      FieldName = 'BBK'
      Origin = 'BOOK_LIST.BBK'
      Size = 150
    end
    object qryBookListMESTOIZD: TIBStringField
      FieldName = 'MESTOIZD'
      Origin = 'BOOK_LIST.MESTOIZD'
      Size = 150
    end
    object qryBookListIZDAT: TIBStringField
      FieldName = 'IZDAT'
      Origin = 'BOOK_LIST.IZDAT'
      Size = 150
    end
    object qryBookListGODN: TIBStringField
      FieldName = 'GODN'
      Origin = 'BOOK_LIST.GODN'
      Size = 9
    end
    object qryBookListEKZ: TIntegerField
      FieldName = 'EKZ'
      Origin = 'BOOK_LIST.EKZ'
    end
    object qryBookListIZD: TStringField
      FieldKind = fkCalculated
      FieldName = 'IZD'
      Size = 60
      Calculated = True
    end
  end
  object sprSpis: TIBStoredProc
    Database = dbArm2
    Transaction = trMainTransaction
    StoredProcName = 'SPIS'
    Left = 280
    Top = 184
    ParamData = <
      item
        DataType = ftString
        Name = 'ID_STR'
        ParamType = ptInput
      end
      item
        DataType = ftString
        Name = 'FIL'
        ParamType = ptInput
      end
      item
        DataType = ftInteger
        Name = 'EKZ_SPIS'
        ParamType = ptInput
      end
      item
        DataType = ftInteger
        Name = 'STATUS'
        ParamType = ptOutput
      end>
  end
  object sprDeleteFromEk: TIBStoredProc
    Database = dbArm2
    Transaction = trMainTransaction
    StoredProcName = 'DELETE_FROM_EK'
    Left = 344
    Top = 184
  end
  object trTmp: TIBTransaction
    Active = False
    DefaultDatabase = dbArm2
    AutoStopAction = saNone
    Left = 88
    Top = 384
  end
end
